package net.dgg.zz.common.files.entity;

/**
 * @Auther: sdx
 * @Date: 2019/12/05
 * @Description:附件地址类型
 */
public enum AnnexEnum {

    /**
     * OSS
     */
    UPLOAD_OSS(1, "OSS"),

    /**
     * FDFS
     */
    UPLOAD_FDFS(2, "FDFS"),
    ;


    /**
     * 操作类型
     */
    private Integer operateType;

    /**
     * 操作类型中文
     */
    private String operateName;

    AnnexEnum(Integer operateType, String operateName) {
        this.operateType = operateType;
        this.operateName = operateName;
    }


    /**
     * 传入日志类型，获取日志对应中文
     *
     * @param operateType 日志类型
     * @return
     */
    public static String getLogOperateName(Integer operateType) {
        AnnexEnum[] values = AnnexEnum.values();
        for (int i = 0; i < values.length; i++) {
            AnnexEnum log = values[i];
            if (log.operateType.equals(operateType)) {
                return log.operateName;
            }
        }
        return null;
    }

    public Integer getOperateType() {
        return operateType;
    }

    public void setOperateType(Integer operateType) {
        this.operateType = operateType;
    }

    public String getOperateName() {
        return operateName;
    }

    public void setOperateName(String operateName) {
        this.operateName = operateName;
    }
}
